package com.sxs.controller;

import cn.hutool.json.JSONObject;
import com.sxs.annotation.RepeatSubmit;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/test")
public class TestController {
    @RepeatSubmit(interval = 10, message = "请勿重复提交！")
    @PostMapping("/save")
    public String hello(@RequestBody JSONObject data) {
        log.info("请求参数{}", data);
        return "success";
    }
}
